<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./vue/vue.js"></script>
    <style>
        .hl {
            background-color: yellow;
        }
    </style>
    <title>Document</title>
</head>
<body>
    <div id="demo">
        <span class="hl" >dfsadfdsfsdfdasfsdfsf</span>
        <span :class="isHighlight?setHlClass:''" >dfsadfdsfsdfdasfsdfsf</span>
        <button @click="changeHlStatus">change!</button>
    </div>

    <script>
        var app = new Vue({
            el: "#demo",
            data: {
                isHighlight: true,
                setHlClass: "hl", 
            },
            methods: {
                changeHlStatus: function () {
                    this.isHighlight = !this.isHighlight;             
                }
            }
        });
    </script>
</body>
</html>